<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>

description("This tests querying usage and quota using Quota API.");

function errorCallback(error)
{
    testFailed("Error occurred: " + error);
    finishJSTest();
}

var returnedUsage, returnedQuota;
function usageCallback(usage, quota)
{
    returnedUsage = usage;
    returnedQuota = quota;

    // Quota value would vary depending on the test environment.
    shouldBeGreaterThanOrEqual("returnedUsage", "0");
    shouldBeGreaterThanOrEqual("returnedQuota", "returnedUsage");

    finishJSTest();
}

if (navigator.webkitTemporaryStorage) {
    window.jsTestIsAsync = true;
    navigator.webkitTemporaryStorage.queryUsageAndQuota(usageCallback, errorCallback);
}

window.successfullyParsed = true;

</script>
</body>
</html>
